<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function deleterepetition(arr) {
            var arr1 = [];
            arr1[0] = arr[0];
            var n = 1;
            for (var i = 1; i < arr.length; i++) {
                for (var j = 0; j < arr1.length; j++) {
                    if (arr[i] == arr1[j]) {
                        break;
                    }
                    if (j == arr1.length-1) {
                        arr1[n] = arr[i];
                        n++;
                    }
                }
            }
            return arr1;
        }

        console.log(deleterepetition([1,1,1,2,2,3,4,5,6,3,4,2,4,1,]));
    </script>
</head>
<body>
    
</body>
</html>